<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>成功提交订单</title>
	<link rel="stylesheet" href="./css/base.css" type="text/css">
	<link rel="stylesheet" href="./css/global.css" type="text/css">
	<link rel="stylesheet" href="./css/header.css" type="text/css">
	<link rel="stylesheet" href="./css/success.css" type="text/css">
	<link rel="stylesheet" href="./css/footer.css" type="text/css">
</head>
<body>
	<!-- 顶部导航 start -->
	<script src="./js/top.js"></script>
	<!-- 顶部导航 end -->
	
	<div style="clear:both;"></div>
	
	<!-- 页面头部 start -->
	<div class="header w990 bc mt15">
		<div class="logo w990">
			<h2 class="fl"><a href="index.html"><img src="./imgs/logo.png" alt="京西商城"></a></h2>
			<div class="flow fr flow3">
				<ul>
					<li>1.我的购物车</li>
					<li>2.填写核对订单信息</li>
					<li class="cur">3.成功提交订单</li>
				</ul>
			</div>
		</div>
	</div>
	<!-- 页面头部 end -->
	
	<div style="clear:both;"></div>

	<!-- 主体部分 start -->
	<div class="success w990 bc mt15">
		<div class="success_hd">
			<h2>订单提交成功</h2>
		</div>
		<div class="success_bd">
			<p><span></span>订单提交成功，我们将及时为您处理</p>
			<p>
				<a class="payUrl" href="javascript:;">
					<img height="130" src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=524258353,375193325&fm=26&gp=0.jpg" alt="">
				</a>
				<img height="120" id="wxpay" style="cursor:pointer;" src="https://dss2.bdstatic.com/6Ot1bjeh1BF3odCf/it/u=1447498112,600524530&fm=85&app=79&f=JPG?w=121&h=75&s=188FA15AB1206D1108400056000040F6" />
			</p>
			<p class="message">完成支付后，你可以 <a href="./order.html">查看订单状态</a>  <a href="./list.html">继续购物</a> <a href="">问题反馈</a></p>
		</div>
	</div>
	<!-- 主体部分 end -->

	<div style="clear:both;"></div>
	<!-- 底部版权 start -->
	<div class="footer w1210 bc mt15">
		<p class="links">
			<a href="">关于我们</a> |
			<a href="">联系我们</a> |
			<a href="">人才招聘</a> |
			<a href="">商家入驻</a> |
			<a href="">千寻网</a> |
			<a href="">奢侈品网</a> |
			<a href="">广告服务</a> |
			<a href="">移动终端</a> |
			<a href="">友情链接</a> |
			<a href="">销售联盟</a> |
			<a href="">京西论坛</a>
		</p>
		<p class="copyright">
			 © 2005-2013 京东网上商城 版权所有，并保留所有权利。  ICP备案证书号:京ICP证070359号 
		</p>
		<p class="auth">
			<a href=""><img src="./imgs/xin.png" alt="" /></a>
			<a href=""><img src="./imgs/kexin.jpg" alt="" /></a>
			<a href=""><img src="./imgs/police.jpg" alt="" /></a>
			<a href=""><img src="./imgs/beian.gif" alt="" /></a>
		</p>
	</div>
	<!-- 底部版权 end -->
	<style>
	.box {position:absolute;width: 220px; height: 220px; left:50%;top:50%; margin-left: -100px; margin-top: -100px;border: solid 1px black;background:#fff;display:none;} 
	</style>
	<div class="box">
	<iframe id="myframe" width="220" height="220" src="" scrolling="no"></iframe>
	<div>
</body>
</html>
<script src="./js/utils.js"></script>
<script src="./js/jquery-1.8.3.min.js"></script>
<script>
	$(function() {
		let sn = getParams('sn')
		let price = getParams('price')
	
		// 支付宝支付
		$('.payUrl').attr('href', `
		http://kg.zhaodashen.cn/v1/alipay/pagepay/pagepay.jsp?trade_no=${sn}&amount=${price}
		`)
	
		// 微信支付
		$('.box iframe').attr('src', 'http://kg.zhaodashen.cn/v1/wxpay/native.jsp?out_trade_no='+sn)
	
		$('#wxpay').click(function() {
			$('.box').css('display', 'block')
		})
		$('body').click(function(e) {
			if (e.target.nodeName=='IMG') return
			$('.box').css('display', 'none')
		})
	
		setInterval(() =>{
			$.post('http://kg.zhaodashen.cn//api/v1/wxpay/ispay.jsp?out_trade_no='+sn, {}, res => {
				if(res.meta.state == 201){
					alert('支付成功，跳转中...')
					location.href="./order.html"
				}
			}, 'json')
		}, 1000)
	})
	</script>